﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FlowFrameWork.aspx.cs" Inherits="Admin.WorkFlow.FlowFrameWork" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>项目流程</title>
    <script>
        function SelectUsers(state,nextstate) {
            window.open("Select_Users.aspx?nextstate="+nextstate+"&formid=<%=ViewState["formid"]%>&flowid=<%=ViewState["flowid"]%>&nodeid=<%=nodeid%>&nextnodeid=<%=NextNodeId%>&node=<%=NextNode%>&state="+state, "选人", "top=" + (screen.height - 420) / 2 + ",left=" + (screen.width - 800) / 2 + ",width=800,height=420");
        }
        function formedit()
        {
            window.open("../formtable/<%=modifyForm%>?formid=<%=ViewState["formid"]%>&flowid=<%=ViewState["flowid"]%>&nodeid=<%=ViewState["nodeid"]%>&projectid=<%=ViewState["projectid"]%>");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" bgcolor="#666699">
            <tr>
                <td align="left" valign="middle" height="25px" style="color: Yellow">
                    <b>名称：</b><asp:Label ID="labTitle" runat="server"></asp:Label>
                    &nbsp;&nbsp;&nbsp;&nbsp;（<asp:Label ID="labFlowType" runat="server"></asp:Label>）
                </td>
            </tr>
        </table>
        <!--表单区-->
        <iframe width="100%" id="aa" name="bb" height="<%=iframeHeight%>" src="LoadForm.aspx?formid=<%=ViewState["formid"]%>&flowid=<%=ViewState["flowid"]%>&nodeid=<%=ViewState["nodeid"]%>&projectid=<%=ViewState["projectid"]%>&state=<%=ViewState["state"]%>"
            frameborder="0"></iframe>
        <!--消息显示区-->
        <asp:Panel ID="msgPanel" runat="server" CssClass="panel">
            <table width="100%" bgcolor="#eeeeee">
                <tr>
                    <td align="center" valign="middle" height="25px">
                        <b>审批意见</b>
                    </td>
                </tr>
            </table>
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td valign="top">
                        <table width="100%" cellpadding="0" cellspacing="0" bordercolorlight="#99ccff" bordercolordark="white"
                            border="1" runat="server" id="tbAttach" visible="false">
                            <tr>
                                <td width="260px" height="50px" align="right" style="padding-right: 20px">
                                    附件信息
                                </td>
                                <td>
                                    <asp:Repeater ID="AttachList" runat="server" DataSourceID="SqlDataSource3">
                                        <ItemTemplate>
                                            <table width="100%" style="font-size:14px">
                                                <tr>
                                                    <td>
                                                        <a href="../attach/<%# Eval("path") %>/<%# Eval("Attach") %>" target="_blank">
                                                            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>'></asp:Label></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                                    </td>
                                                    <td width="100px">
                                                        <%#Eval("publishname")%>
                                                    </td>
                                                    <td width="120px">
                                                        <%#Eval("publishdate") %>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                        
                                        SelectCommand="SELECT [id],[fid],[Title], [Attach],[path],[publishdate],[publishname] FROM [Pm_Flow_Attach] WHERE ([fid] = @fid)">
                                        <SelectParameters>
                                            <asp:QueryStringParameter DefaultValue="0" Name="fid" QueryStringField="formid" Type="Decimal" />
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                        <table width="100%" cellpadding="0" cellspacing="0" bordercolorlight="#99ccff" bordercolordark="white"
                            border="1" runat="server" id="tbNgr" visible="false">
                            <tr>
                                <td width="200px" height="50px" align="right" style="padding-right: 20px">
                                    <asp:Label ID="lbYj" runat="server"></asp:Label>:
                                </td>
                                <td>
                                    <div id="divspan">
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <asp:Repeater ID="msgShow" runat="server" DataSourceID="SqlDataSource1">
                            <ItemTemplate>
                                <table width="100%" cellpadding="0" cellspacing="0" bordercolorlight="#99ccff" bordercolordark="white"
                                    border="1">
                                    <tr>
                                        <td width="200px" height="50px" align="right" style="padding-right: 20px;font-size:14px">
                                            <%# DataBinder.Eval(Container.DataItem, "NodeName")%>:
                                        </td>
                                        <td style="font-size:14px">
                                            <%# GetContent(DataBinder.Eval(Container.DataItem, "id").ToString())%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:Repeater>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                            SelectCommand="SELECT [nodeName],id FROM [Pm_Flow_Node] where msgNode='是' and flowid=@flowid  ORDER BY [state]">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="flowid" QueryStringField="flowid" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <table width="100%" cellpadding="0" cellspacing="0" bordercolorlight="#99ccff" bordercolordark="white"
                            border="1" runat="server" id="msgReceive" visible="false">
                            <tr>
                                <td width="260px" height="50px" align="right" style="padding-right: 20px">
                                    收到情况:
                                </td>
                                <td>
                                    <div id="div1">
                                        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
                                            <HeaderTemplate>
                                                <table width="100%" cellpadding="0" cellspacing="0" bordercolorlight="#99ccff" bordercolordark="white"
                                                    border="0" style="padding-left: 10px">
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <tr>
                                                    <td width="100px" height="30px" align="right" style="padding-right: 20px;font-size:14px">
                                                        <%# DataBinder.Eval(Container.DataItem, "UserName")%>:
                                                    </td>
                                                    <td style="font-size:14px">
                                                        <%# GetState(DataBinder.Eval(Container.DataItem, "state").ToString())%>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                </table>
                                            </FooterTemplate>
                                        </asp:Repeater>
                                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                            SelectCommand="SELECT [UserName],state,id FROM [Pm_Flow_State] where state<>'3' and state<>'4' and  node='88' and flowid=@flowid and formid=@formid  ORDER BY [id]">
                                            <SelectParameters>
                                                <asp:QueryStringParameter Name="flowid" QueryStringField="flowid" />
                                                <asp:QueryStringParameter Name="formid" QueryStringField="formid" />
                                            </SelectParameters>
                                        </asp:SqlDataSource>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width="350px" style="border: 1px solid #99ccff" valign="top">
                        <div>
                            办理意见过程明细:</div>
                        <asp:Repeater ID="msgAllShow" runat="server" DataSourceID="SqlDataSource4">
                            <ItemTemplate>
                                <table width="100%" cellpadding="0" cellspacing="0" bordercolorlight="#99ccff" bordercolordark="white">
                                    <tr>
                                        <td width="130px" height="25px" align="left" style="padding-right: 20px; padding-left: 20px;
                                            border-bottom: 0px solid gray; font-size: 12px">
                                            <%# DataBinder.Eval(Container.DataItem, "nodeMsg")%>:
                                        </td>
                                        <td style="padding-right: 20px; border-bottom: 0px solid gray; font-size: 12px">
                                            <%# DataBinder.Eval(Container.DataItem, "userName").ToString()%>&nbsp;&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "publishdate").ToString()%></td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:Repeater>
                        <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                            SelectCommand="SELECT [nodeMsg],userName,publishdate FROM [Pm_Flow_Message] where  flowid=@flowid and formid=@formid  ORDER BY [id]">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="flowid" QueryStringField="flowid" />
                                <asp:QueryStringParameter Name="formid" QueryStringField="formid" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <!--消息发布区-->
        <%-- <hr size="1px" color="red" width="100%" />--%>
        <div id="divmsg" runat="server">
            <table width="100%">
                <tr>
                    <td width="550px">
                        <asp:TextBox ID="txtMsg" runat="server" TextMode="MultiLine" Height="50px" Width="400px"
                            CssClass="TextBox" Text="阅"></asp:TextBox>
                    </td>
                    <td align="left">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <input type="button" id="btEdit" value="表单填写" onclick="javascript:formedit()" class="Input"
                                        runat="server" visible="false" style="background-color: Orange;margin-top:5px"/>
                                </td>
                            </tr>
                            <tr>
                                <td >
                                    <asp:Button ID="btPre" runat="server" Text="" OnClick="btPre_Click" Visible="false" style="margin-top:5px;background-color:#ecfdd9"
                                        CssClass="Input" />
                                </td>
                            </tr>
                            <tr>
                                <td >
                                    <asp:Button ID="btNext" runat="server" Text="" OnClick="btNext_Click" CssClass="Input" style="margin-top:5px;background-color:#ecfdd9"/>
                                    <%--<object name="sign1" id="AssureSealHTMLCtl1" classid="CLSID:5F01FB31-E76F-46AD-BA34-1269F637D4E5"
                            codebase="http://www.hzca.org.cn/iWebSign/SealCtrl.cab#version=1,0,0,0">
                            <yckparam name="identifier" value="<%=ViewState["CAId"]%>" />
                            <yckparam name="include" value="txtMsg" />
                            <yckparam name="sealtype" value="3" />
                            <yckparam name="Width" value="100" />
                            <yckparam name="Height" value="50" />
                            <yckparam name="serviceentry" value="http://192.168.17.224:8080/iWebSign/Services/entry" />
                        </object>
                        <script type="text/javascript">
                            function btCa_onclick() {
                                ret = document.form1.sign1.GetItName();
                                if (ret == "<%=Session["UserName"]%>")
                                {
                                    ret1 = document.form1.sign1.SignSeal();
                                    if (ret1.indexOf("1") == 0) {
                                        ret2 = document.form1.sign1.SaveSeal();
                                        if (ret2.indexOf("1") == 0) {
                                            alert("签章完成！");
                                            return true;
                                        }
                                    }
                                    return false;
                                }
                                else
                                {
                                    alert("当前用户是 <%=Session["UserName"]%>，请不要使用 "+ret+" 的KEY！");
                                    return false;
                                }
                            }
                        </script>--%>
                                    <asp:Button ID="btSelectMans" runat="server" Text="" Style="display: none;margin-top:5px;background-color:#ecfdd9" CssClass="Input"
                                        OnClick="btSelectMans_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="button" id="btAttach" value="添加附件" onclick="javascript:att()" class="Input"
                                        runat="server" visible="false" style="margin-top:5px;background-color:#ecfdd9"/>
                                    <script>
                                        function att() {
                                            window.open('Attach.aspx?fid=<%=ViewState["formid"]%>')
                                        }
                                    </script>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <div style="margin: 0 auto; width: 50px">
            <asp:Button ID="btGd" runat="server" Text="" OnClick="btGd_Click" CssClass="Input"
                Visible="false" /></div>
    </div>
    </form>
    <%=sScript%>

</body>
</html>
